package com.pennywise.mapper;

import com.pennywise.model.UserProfile;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserProfileMapper {
    
    @Select("SELECT * FROM user_profile LIMIT 1")
    UserProfile getCurrentProfile();
    
    @Insert("""
        INSERT INTO user_profile (monthly_salary, salary_day, year_end_target, create_time, update_time)
        VALUES (#{monthlySalary}, #{salaryDay}, #{yearEndTarget}, #{createTime}, #{updateTime})
    """)
    void insert(UserProfile profile);
    
    @Update("""
        UPDATE user_profile SET
        monthly_salary = #{monthlySalary},
        salary_day = #{salaryDay},
        year_end_target = #{yearEndTarget},
        update_time = #{updateTime}
        WHERE id = #{id}
    """)
    void update(UserProfile profile);
} 